package com.mccrea.pattern.memento;

/**
 * @Classname Originator
 * @Description 发起人
 * @Date 2021/5/24 0024 13:48
 * @Created by Mccrea_Gao
 */
public class Originator {
    private String state;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Memento createMemento() {
        return new Memento(state);
    }

    public void restoreMemento(Memento memento) {
        this.setState(memento.getState());
    }
}
